package com.muki.simple.tool;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateFormatterOwner {

	private static SimpleDateFormat simpleDateFormat;
	
	public static void createDateFormatter(String pattern) {
		simpleDateFormat = new SimpleDateFormat(pattern);
	}
	
	public static String getDateTimeString() {
		return simpleDateFormat.format(new Date());
	}
	
	public static Date getDateTime(String source) throws ParseException {
		return simpleDateFormat.parse(source);
	}
}
